package org.smile.playground;

import java.util.Scanner;

public class Power {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        int j = scanner.nextInt();

        Power p = new Power();
        System.out.println(p.doPower(i, j));

    }

    public int doPower(int x, int y) {
        if (y == 0) return 1;
        if (y < 0) return -1;
        int m = x;
        while (y > 1) {
            m = m * x;
            y--;
        }
        return m;
    }
}
